<template>
	<view class='productSort' :style="{top:navH+'rpx'}" @touchmove.prevent @tap.stop="" @touchmove.stop.prevent="">
		<view class="addFilter" id="addFilter">
			<!-- 发货地 -->
			<view v-for="(item,index) in shaixuan.stockArea" @click.stop="addItem(item,index,1)" :key="item.id">
				{{$t(`publicLang.${item.name}`)}} <text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 品牌 -->
			<view v-for="(item,index) in shaixuan.brandIds" @click.stop="addItem(item,index,2)" :key="item.name">
				<block v-if="locale=='zh'">{{item.name}}</block>
				<block v-if="locale=='en'">{{item.enName}}</block>
				<block v-if="locale=='ita'">{{item.itName}}</block> <text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 平常的分类 -->
			<view v-for="(item,index) in shaixuan.cids" @click.stop="addItem(item,index,3)" :key="item.name">
				{{item.name}} <text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 供应商 -->
			<view v-for="(item,index) in shaixuan.supplierIds" @click.stop="addItem(item,index,4)" :key="item.id"
				v-if="activeIndex==0">
				{{item.name}} <text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 尺码 -->
			<!-- <view v-for="(item,index) in shaixuan.attrs" @click.stop="addItem(item,index,3)" :key="item.name">{{item.name}} <text class="iconfont iconguanbi1"></text></view> -->
			<!-- 季节 -->
			<view v-if="shaixuan.seasonCode" @click.stop="addItem(shaixuan.seasonCode,0,5)">
				{{shaixuan.seasonCode.name}}<text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 专区 -->
			<view v-if="shaixuan.zoneId" @click.stop="addItem(shaixuan.zoneId,0,6)">{{shaixuan.zoneId.name}}<text
					class="iconfont iconguanbi1"></text></view>
			<!-- 售价调整方式 -->
			<view v-if="shaixuan.premiumType" @click.stop="addItem(shaixuan.premiumType,0,7)">
				{{shaixuan.premiumType.name}}<text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 自建转云仓商品审核状态 -->
			<view v-for="(item,index) in shaixuan.stateType" @click.stop="addItem(item,index,8)" :key="item.id">
				{{$t(`publicLang.${item.name}`)}} <text class="iconfont iconguanbi1"></text>
			</view>
			<!-- <view v-for="(item,index) in shaixuan.zoneId" @click.stop="addItem(item,index,6)" :key="item.name">{{item.name}} <text class="iconfont iconguanbi1"></text></view> -->
			<!-- 价格 -->
			<view
				v-if="shaixuan.minPrice && shaixuan.minPrice != 0 && (!shaixuan.maxPrice || shaixuan.maxPrice == 0 || shaixuan.maxPrice == '')"
				@click.stop="delPriceItem()">{{$t("goods.notLess")}}{{moneyType + shaixuan.minPrice}} <text
					class="iconfont iconguanbi1"></text></view>
			<view
				v-else-if="shaixuan.maxPrice && shaixuan.maxPrice != 0 && (!shaixuan.minPrice || shaixuan.minPrice == 0 || shaixuan.minPrice == '')"
				@click.stop="delPriceItem()">{{$t("goods.notHigher")}}{{moneyType + shaixuan.maxPrice}} <text
					class="iconfont iconguanbi1"></text></view>
			<view v-else-if="shaixuan.minPrice && shaixuan.minPrice != 0 && shaixuan.maxPrice && shaixuan.maxPrice != 0"
				@click.stop="delPriceItem()">{{moneyType + shaixuan.minPrice + '-' + moneyType + shaixuan.maxPrice}}
				<text class="iconfont iconguanbi1"></text>
			</view>
			<!-- 折扣 -->
			<view
				v-if="shaixuan.minDiscount && shaixuan.minDiscount != 0 && (!shaixuan.maxDiscount || shaixuan.maxDiscount == 0 || shaixuan.maxDiscount == '')"
				@click.stop="delDiscountItem()">{{$t("goods.minDiscount",{Number:shaixuan.minDiscount})}} <text
					class="iconfont iconguanbi1"></text>
			</view>
			<view
				v-else-if="shaixuan.maxDiscount && shaixuan.maxDiscount != 0 && (!shaixuan.minDiscount || shaixuan.minDiscount == 0 || shaixuan.minDiscount == '')"
				@click.stop="delDiscountItem()">{{$t("goods.maxDiscount",{Number:shaixuan.maxDiscount})}} <text
					class="iconfont iconguanbi1"></text>
			</view>
			<view
				v-else-if="shaixuan.minDiscount && shaixuan.minDiscount != 0 && shaixuan.maxDiscount && shaixuan.maxDiscount != 0"
				@click.stop="delDiscountItem()">
				{{$t("goods.minAndMaxDiscount",{minNumber:shaixuan.minDiscount,maxNumber:shaixuan.maxDiscount})}}<text
					class="iconfont iconguanbi1"></text></view>
		</view>
		<view class="warpCon" :style="{height: 'calc(100vh - '+ addFilterHeight +'px)'}">
			<view class='aside' :style="{height: 'calc(100vh - ' + addFilterHeight +'px)'}">
				<!-- 发货地，品牌的导航条 -->
				<view v-if="!isDiqu" class="item acea-row row-center-wrapper" :class='0==addNum?"on":""'
					@click.stop="clickTap(0)">
					<text>{{$t("goods.placeOfShipment")}}</text>
					<!--发货地-->
				</view>
				<view v-if="!isPinPai" class="item acea-row row-center-wrapper" :class='1==addNum?"on":""'
					@click.stop="clickTap(1)">
					<text>{{$t("goods.brand")}}</text>
					<!--品牌-->
				</view>
				<!-- <view class="item acea-row row-center-wrapper" :class='2==addNum?"on":""' @click.stop="clickTap(2)">
          <text>尺码</text>
        </view> -->
				<!-- <view v-if="activeIndex==0" class="item acea-row row-center-wrapper" :class='2==addNum?"on":""'
					@click.stop="clickTap(2)">
					<text>供应商</text>
				</view> -->
				<view class="item acea-row row-center-wrapper" :class='3==addNum?"on":""' @click.stop="clickTap(3)">
					<text>{{$t("goods.sellingPrice")}}</text>
					<!--售价-->
				</view>
				<view class="item acea-row row-center-wrapper" :class='4==addNum?"on":""' @click.stop="clickTap(4)">
					<text>{{$t("goods.discount")}}</text>
					<!--折扣-->
				</view>
				<view class="item acea-row row-center-wrapper" :class='5==addNum?"on":""' @click.stop="clickTap(5)">
					<text>{{$t("goods.season")}}</text>
					<!--季节-->
				</view>
				<view class="item acea-row row-center-wrapper" :class='6==addNum?"on":""' @click.stop="clickTap(6)">
					<text>{{$t("goods.zone")}}</text>
					<!--专区-->
				</view>
				<view v-if="activeIndex==0" class="item acea-row row-center-wrapper" :class='7==addNum?"on":""'
					@click.stop="clickTap(7)">
					<text>{{$t("goods.priceMethod")}}</text>
					<!--售价方式-->
				</view>
				<view class="item acea-row row-center-wrapper" :class='8==addNum?"on":""' @click.stop="clickTap(8)">
					<text>{{$t("goods.approvalStatus")}}</text>
					<!--审核状态-->
				</view>
				<!-- 平常分类的导航 -->
				<view class='item acea-row row-center-wrapper' :class='index ==navActive?"on":""'
					v-for="(item,index) in productList" :key="index" @click.stop='tap(index,"b"+index)'>
					<text v-if="locale=='zh'">{{item.name}}</text>
					<text v-if="locale=='en'">{{item.enName}}</text>
					<text v-if="locale=='ita'">{{item.itName}}</text>
				</view>
			</view>
			<!-- 地区 -->
			<view class="brand_box" v-if="areaShow" :style="{height: 'calc(100vh - ' + addFilterHeight +'px)'}">
				<view class="areaBox" v-for="(item,index) in stockAreaList" :key="item.name">
					<view :class="item.status?'changeW':'changeW2'" :data-index="index"
						@click.stop="addItem(item,index,1)">{{$t(`publicLang.${item.name}`)}}</view>
				</view>
			</view>
			<!-- 品牌 -->
			<view class="brand_box uni-indexed-list" ref="list" id="list" v-if="brandShow">
				<scroll-view :scroll-into-view="scrollViewId" class="uni-indexed-list__scroll" scroll-y>
					<view v-for="(list, idx) in brandList" :key="idx" :id="'uni-indexed-list-' + idx">
						<!-- <indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></indexed-list-item> -->
						<view class="item_title">{{list.title}}</view>
						<view :style="{color:item1.status?'#af8a40':'#222'}" class="item_brand"
							v-for="(item1, index1) in list.item" :key='index1' @click.stop="addItem(item1,index1,2)">
							{{item1.enName}}
						</view>
					</view>
				</scroll-view>

				<view class="uni-indexed-list__menu" :class="touchmove ? 'uni-indexed-list__menu--active' : ''"
					@touchstart="touchStart" @touchmove.stop.prevent="touchMove" @touchend="touchEnd">
					<view v-for="(list, key) in brandList" :key="key" class="uni-indexed-list__menu-item"
						:id="'pinpaiTabItem'+key">
						<text class="uni-indexed-list__menu-text"
							:class="touchmoveIndex == key ? 'uni-indexed-list__menu-text--active' : ''">{{ list.title }}</text>
					</view>
				</view>
				<view v-if="touchmove" class="uni-indexed-list__alert-wrapper">
					<text class="uni-indexed-list__alert">{{ brandList[touchmoveIndex].title }}</text>
				</view>
			</view>
			<!-- 供应商 -->
			<view v-if="supplierShow && activeIndex==0" class="brand_box">
				<scroll-view scroll-y :style="{height: 'calc(100vh - ' + addFilterHeight+'px)'}">
					<view class="areaBox" v-for="(item,index) in supplierList" :key="item.id">
						<view :class="item.status?'changeW':'changeW2'" :data-index="index"
							@click.stop="addItem(item,index,4)">{{item.name}}</view>
					</view>
				</scroll-view>
			</view>
			<!-- 售价方式 -->
			<view v-if="priceTypeShow && activeIndex==0" class="brand_box">
				<scroll-view scroll-y :style="{height: 'calc(100vh - ' + addFilterHeight+'px)'}">
					<view class="areaBox" v-for="(item,index) in priceTypeList" :key="item.id">
						<view :class="item.status?'changeW':'changeW2'" :data-index="index"
							@click.stop="addItem(item,index,7)">{{item.name}}</view>
					</view>
				</scroll-view>
			</view>
			<!-- 审核状态 -->
			<view v-if="stateTypeShow" class="brand_box">
				<scroll-view scroll-y :style="{height: 'calc(100vh - ' + addFilterHeight+'px)'}">
					<view class="areaBox" v-for="(item,index) in stateTypeList" :key="item.id">
						<view :class="item.status?'changeW':'changeW2'" :data-index="index"
							@click.stop="addItem(item,index,8)">{{item.name}}</view>
					</view>
				</scroll-view>
			</view>
			<!-- 专区 -->
			<view v-if="zhuanquShow" class="brand_box">
				<scroll-view scroll-y :style="{height: 'calc(100vh - ' + addFilterHeight+'px)'}">
					<view class="areaBox" v-for="(item,index) in zhuanquList" :key="item.id">
						<view :class="item.status?'changeW':'changeW2'" :data-index="index"
							@click.stop="addItem(item,index,6)">{{item.name}}</view>
					</view>
				</scroll-view>
			</view>
			<!-- 季节 -->
			<view v-if="seasonShow" class="brand_box">
				<scroll-view scroll-y :style="{height: 'calc(100vh - ' + addFilterHeight+'px)'}">
					<view class="areaBox" v-for="(item,index) in seasonList" :key="item.name">
						<view :class="item.status?'changeW':'changeW2'" :data-index="index"
							@click.stop="addItem(item,index,5)">{{item.name}}</view>
					</view>
				</scroll-view>
			</view>
			<!-- 尺码 -->
			<!-- <view class="brand_box size_box" v-if="sizeShow" :style="{height: 'calc(100vh - ' + addFilterHeight +'px)'}">
				<view class="areaBox" v-for="(item,index) in sizeList" :key="item.name">
					<view :class="item.status?'changeW2':'changeW'" :data-index="index" @click.stop="addItem(item,index,4)">{{item.name}}</view>
				</view>
				<view style="width: 90%; height: 2rpx;background-color: #333;margin: 0 auto;"></view>
				<view class="areaBox" v-for="(item,index) in sizeNumLise" :key="item.name">
					<view :class="item.status?'changeW2':'changeW'" :data-index="index" @click.stop="addItem(item,index,5)">{{item.name}}</view>
				</view>
			</view> -->
			<!-- 价格 -->
			<view class="brand_box price_box" v-if="priceShow"
				:style="{height: 'calc(100vh - ' + addFilterHeight +'px)'}">
				<view class="price_content">
					<input type="number" class="priceInput" :placeholder="$t('goods.minimum')"
						@input="bandPriceInputMin" :value="shaixuanReq.minPrice" />
					<view class="priceLink"></view>
					<input type="number" class="priceInput" :placeholder="$t('goods.maximum')"
						@input="bandPriceInputMax" :value="shaixuanReq.maxPrice" />
				</view>
			</view>
			<!-- 折扣 -->
			<view class="brand_box price_box" v-if="DiscountShow"
				:style="{height: 'calc(100vh - ' + addFilterHeight +'px)'}">
				<view class="price_content">
					<input type="digit" class="priceInput" :placeholder="$t('goods.minimum')" @input="DiscountInputMin"
						v-model="shaixuanReq.minDiscount" />
					<view class="priceLink"></view>
					<input type="digit" class="priceInput" :placeholder="$t('goods.maximum')" @input="DiscountInputMax"
						v-model="shaixuanReq.maxDiscount" />
				</view>
			</view>
			<view class='conter' v-if="classCS">
				<!-- 分类的子集 -->
				<block v-for="(items,indexs) in productList" :key="indexs">
					<scroll-view scroll-y="true" v-if="navActive==indexs" @scroll="scroll" scroll-with-animation='true'
						:style="{height: 'calc(100vh - ' + addFilterHeight+'px)'}">
						<block v-for="(item,index) in items.child" :key="index">
							<view class='listw' :id="'b'+index">
								<view class='title'>
									<view class='name' v-if="locale=='zh'">{{item.name}}</view>
									<view class='name' v-if="locale=='en'">{{item.enName}}</view>
									<view class='name' v-if="locale=='ita'">{{item.itName}}</view>
								</view>
								<view class='list acea-row'>
									<block v-for="(itemn,indexn) in item.child" :key="indexn">
										<view hover-class='none' class='item' @click.stop="addItem(itemn,index,3)">
											<u-image width="124rpx" height="124rpx" :loading-icon="imgLoadBG"
												:src="itemn.extra" mode="aspectFit"></u-image>
											<view :class="itemn.status?'name line1':'changeColor'">
												<block v-if="locale=='zh'">{{itemn.name}}</block>
												<block v-if="locale=='en'">{{itemn.enName}}</block>
												<block v-if="locale=='ita'">{{itemn.itName}}</block>
											</view>
										</view>

									</block>
								</view>
							</view>
						</block>
					</scroll-view>
				</block>
			</view>
		</view>
		<view class="bottomNav" id="bottomNav">
			<view class="beforCurrent" @click.stop="cancelBtn">{{$t("goods.reset")}}</view>
			<!--重置-->
			<view class="afterCurrent" @click.stop="seeLook">
				<text>{{$t("goods.viewItems")}}</text>
				<!--查看商品-->
			</view>
		</view>
	</view>
</template>

<script>
	let app = getApp();
	import {
		categoryApi,
		getProductslist
	} from "@/api/store.js";
	import {
		getStockArea,
		getVisibleSupplier,
		getBrandList,
		zoneList,
		seasonListMer,
	} from "@/api/storeGoods.js";
	import {
		HTTP_REQUEST_URL
	} from "@/config/app";
	import {
		formatTime
	} from "@/utils/common.js";
	export default {
		props: {
			//筛选条件
			shaixuan1: {
				type: Object,
				default: function() {
					return {
						brandIds: [],
						cids: [],
						stockArea: [],
					};
				},
			},
			shaixuan2: {
				type: Object,
				default: function() {
					return {
						brandIds: [],
						cids: [],
						stockArea: [],
					};
				},
			},
			activeIndex: {
				type: Number,
				value: '',
			},
			isDiqu: {
				type: Boolean,
				value: false,
			},
			diquType: {
				type: String,
				value: "",
			},
			isPinPai: {
				type: Boolean,
				value: false,
			},
			pinpaiId: {
				type: String,
				value: "",
			},
			isTusou: {
				type: Boolean,
				value: false,
			},
			tusouImg: {
				type: String,
				value: "",
			},
			keyword: {
				type: String,
				value: "",
			},
			bottomH: {
				type: Boolean,
				value: false,
			},

		},
		data() {
			return {
				navH: 0,
				navlist: [],
				productList: [],
				supplierList: [],
				zhuanquList: [],
				seasonList: [],
				navActive: "wei",
				number: "",
				hightArr: [],
				toView: "",
				tabList: ["分类", "品牌"],
				tabIndex: 0,
				scrollId: "",
				brandIndex: -1,
				brandList: [],
				addList: ["发货地", "品牌"],
				stockAreaList: [],
				tabItem: [
					"A",
					"B",
					"C",
					"D",
					"E",
					"F",
					"G",
					"H",
					"I",
					"J",
					"K",
					"L",
					"M",
					"N",
					"O",
					"P",
					"Q",
					"R",
					"S",
					"T",
					"U",
					"V",
					"W",
					"X",
					"Y",
					"Z",
					"#",
				],
				//   sizeList: [
				//     { name: "XXS", status: false },
				//     { name: "XS", status: false },
				//     { name: "S", status: false },
				//     { name: "M", status: false },
				//     { name: "L", status: false },
				//     { name: "XL", status: false },
				//     { name: "XXL", status: false },
				//   ],
				//   sizeNumLise: [
				//     { name: "34", status: false },
				//     { name: "34.5", status: false },
				//     { name: "35", status: false },
				//     { name: "35.5", status: false },
				//     { name: "36", status: false },
				//     { name: "36.5", status: false },
				//     { name: "37", status: false },
				//     { name: "37.5", status: false },
				//     { name: "38", status: false },
				//     { name: "38.5", status: false },
				//     { name: "39", status: false },
				//     { name: "39.5", status: false },
				//     { name: "40", status: false },
				//     { name: "40.5", status: false },
				//     { name: "41", status: false },
				//     { name: "41.5", status: false },
				//     { name: "42", status: false },
				//     { name: "42.5", status: false },
				//     { name: "43", status: false },
				//     { name: "43.5", status: false },
				//     { name: "44", status: false },
				//     { name: "44.5", status: false },
				//   ],

				brandShow: false,
				areaShow: true,
				supplierShow: false,
				sizeShow: false,
				priceShow: false,
				DiscountShow: false,
				zhuanquShow: false,
				seasonShow: false,
				priceTypeShow: false,
				stateTypeShow: false,
				//分类是否显示
				classCS: false,
				addNum: "",
				// 总数是多少
				allNum: "",

				shaixuan: {
					brandIds: [],
					cids: [],
					stockArea: [],
					attrs: [],
					supplierIds: [],
					zoneId: "",
					seasonCode: "",
					minPrice: "",
					maxPrice: "",
					minDiscount: "",
					maxDiscount: "",
					premiumType: "",
					stateType: [], // 自建转运仓商品审核状态
				},
				shaixuanReq: {
					brandIds: [],
					cids: [],
					stockArea: [],
					supplierIds: [],
					attrs: [],
					zoneId: "",
					seasonCode: "",
					minPrice: "",
					maxPrice: "",
					minDiscount: "",
					maxDiscount: "",
					premiumType: "",
					stateType: [], // 自建转运仓商品审核状态
				},
				addFilterHeight: 42,
				tusouUrl: "",
				keyWords: "",

				isClickOk: true,

				scrollViewId: "",
				touchmove: false,
				touchmoveIndex: -1,
				itemHeight: 20,
				winOffsetY: 0,

				moneyType: "￥",
				minDiscountLength: 3,
				maxDiscountLength: 3,
				imgLoadBG: app.globalData.imgLoadBG,
				bottomLift: app.globalData.bottomLift,
				tableFrom: {},
			};
		},
		computed: {
			locale() {
				return this.$i18n.locale
			},
			priceTypeList() {
				return [{
						name: this.$t("goods.originalPriceDiscount"), //原价折扣
						id: 4,
						status: true
					},
					{
						name: this.$t("goods.costMarkup"), //成本价加价率
						id: 3,
						status: true
					},
					{
						name: this.$t("goods.defaultMarkupRate"), //默认加价率
						id: 0,
						status: true
					},
					{
						name: this.$t("goods.fixedPrice"), //固定价格
						id: 1,
						status: true
					},
				]
			},
			stateTypeList() {
				return [{
						name: this.$t("publicLang.未推送"), //未推送
						id: 1,
						status: true
					},{
						name: this.$t("publicLang.审核中"), //审核中
						id: 1,
						status: true
					},{
						name: this.$t("publicLang.已通过"), //已通过
						id: 1,
						status: true
					},
					{
						name: this.$t("publicLang.已拒绝"), //已拒绝
						id: 2,
						status: true
					}
				]
			},
		},
		watch: {
			shaixuan1(newValue, oldValue) {
				console.log(newValue, oldValue, 222);
				this.shaixuan = newValue;
			},
			shaixuan2(newValue, oldValue) {
				this.shaixuanReq = newValue;
			},
			diquType(newValue, oldValue) {
				this.shaixuanReq.stockArea = newValue.split(",");
			},
			pinpaiId(newValue, oldValue) {
				this.shaixuanReq.brandIds = newValue.split(",");
			},
			tusouImg(newValue, oldValue) {
				this.tusouUrl = newValue;
			},
			keyword(newValue, oldValue) {
				this.keyWords = newValue;
			},
			activeIndex(newValue, oldValue) {
				this.getZhuanQuList()
			}
		},
		mounted() {
			// #ifdef MP
			this.navH = app.globalData.navHeight;
			// #endif
			// #ifndef MP
			this.navH = 96;
			// #endif
			if (getApp().globalData.waiwangIPdiqu == 1) {
				this.moneyType = "HKD";
			} else if (getApp().globalData.waiwangIPdiqu == 2) {
				this.moneyType = "€";
			}
			this.getAllCategory();
			this.getStockArea();
			if (this.isDiqu) {
				this.clickTap(1);
				this.shaixuanReq.stockArea = this.diquType.split(",");
			}
			if (this.isPinPai) {
				this.shaixuanReq.brandIds = this.pinpaiId.split(",");
			}
			if (this.shaixuanReq.stockArea && this.shaixuanReq.stockArea.length != 0) {
				this.shaixuanReq.stockArea.forEach((data) => {
					this.stockAreaList.map((res) => {
						if (res.id == data) {
							res.status = false;
						}
					});
				});
			}
			// console.log(this.shaixuanReq.attrs,"shaixuanReq.attrs");
			// console.log(this.sizeList,"sizeList");
			// if (this.shaixuanReq.attrs && this.shaixuanReq.attrs.length != 0) {
			//   this.shaixuanReq.attrs.forEach((data) => {
			//     this.sizeList.map((res) => {
			//       if (res.name == data) {
			//         res.status = true;
			//       }
			//     });
			//     this.sizeNumLise.map((res) => {
			//       if (res.name == data) {
			//         res.status = true;
			//       }
			//     });
			//   });
			// }
			this.$nextTick(function() {
				this.getAddFilterHeight();
			});
		},
		methods: {
			//获取高度
			getAddFilterHeight() {
				var that = this;
				var appSearchH = uni.createSelectorQuery().in(that).select("#addFilter");
				appSearchH.boundingClientRect(function(data) {
						that.addFilterHeight = 42 + (that.navH / 2) + data.height;
						if (!that.bottomH) {
							that.addFilterHeight = that.addFilterHeight + that.bottomLift
						}
					})
					.exec();
			},
			// 添加元素
			addItem(item, idx, type) {
				console.info(item)
				var that = this;
				var status = item.status;
				var iss = false;
				var sxIndex = 0;
				if (type == 1) {
					// 判断地点的
					for (var i = 0; i < this.shaixuan.stockArea.length; i++) {
						if (this.shaixuan.stockArea[i].id == item.id) {
							iss = true;
							sxIndex = i;
						}
					}
					if (!iss) {
						this.shaixuan.stockArea.push({
							id: item.id,
							name: item.name,
							status: false,
						});
						this.shaixuanReq.stockArea.push(item.id);
					} else {
						this.shaixuan.stockArea.splice(sxIndex, 1);
						this.shaixuanReq.stockArea.splice(sxIndex, 1);
					}
					this.stockAreaList.map((res) => {
						if (res.id == item.id) {
							res.status = !status;
						}
					});
				} else if (type == 2) {
					for (var i = 0; i < this.shaixuan.brandIds.length; i++) {
						if (this.shaixuan.brandIds[i].id == item.id) {
							iss = true;
							sxIndex = i;
						}
					}
					if (!iss) {
						this.shaixuan.brandIds.push({
							id: item.id,
							name: item.enName,
							status: true,
						});
						this.shaixuanReq.brandIds.push(item.id);
					} else {
						this.shaixuan.brandIds.splice(sxIndex, 1);
						this.shaixuanReq.brandIds.splice(sxIndex, 1);
					}
					this.brandList.map((res) => {
						if (res.item && res.item.length != 0) {
							res.item.map((itemC) => {
								if (itemC.id == item.id) {
									itemC.status = !status;
								}
							});
						}
					});
				} else if (type == 3) {
					if (item.id) {
						item.cids = item.id
					}
					// 判断分类的
					for (var i = 0; i < this.shaixuan.cids.length; i++) {
						if (this.shaixuan.cids[i].cids == item.cids) {
							iss = true;
							sxIndex = i;
						}
					}
					if (!iss) {
						this.shaixuan.cids.push({
							cids: item.cids,
							name: item.name,
							status: false,
							id: item.id
						});
						this.shaixuanReq.cids.push(item.cids);
					} else {
						this.shaixuan.cids.splice(sxIndex, 1);
						this.shaixuanReq.cids.splice(sxIndex, 1);
					}
					this.productList.map((res) => {
						if (res.child && res.child.length != 0) {
							res.child.map((itemB) => {
								if (itemB.child && itemB.child.length != 0) {
									itemB.child.map((itemC) => {
										if (itemC.id == item.cids) {
											setTimeout(function() {
												itemC.status = !status;
											}, 50);
										}
									});
								}
							});
						}
					});
				} else if (type == 4) {
					//   判断供应商
					for (var i = 0; i < this.shaixuan.supplierIds.length; i++) {
						if (this.shaixuan.supplierIds[i].id == item.id) {
							iss = true;
							sxIndex = i;
						}
					}
					if (!iss) {
						this.shaixuan.supplierIds.push({
							id: item.id,
							name: item.name,
							status: false,
						});
						this.shaixuanReq.supplierIds.push(item.id);
					} else {
						this.shaixuan.supplierIds.splice(sxIndex, 1);
						this.shaixuanReq.supplierIds.splice(sxIndex, 1);
					}
					this.supplierList.map((res) => {
						if (res.id == item.id) {
							res.status = !status;
						}
					});
				} else if (type == 5) {
					// 判断季节
					if (this.shaixuan.seasonCode != "" && this.shaixuan.seasonCode.id == item.id) {
						this.shaixuan.seasonCode = "";
						this.shaixuanReq.seasonCode = "";
					} else {
						if (item.name == '-/-') {
							this.shaixuanReq.seasonCode = item.id
						} else {
							this.shaixuanReq.seasonCode = item.name
						}
						this.shaixuan.seasonCode = item;
					}
					this.seasonList.map((res) => {
						item.id == res.id ? (res.status = !res.status) : (res.status = true);
					});
				} else if (type == 6) {
					//   判断专区
					if (this.shaixuan.zoneId != "" && this.shaixuan.zoneId.id == item.id) {
						this.shaixuan.zoneId = "";
						this.shaixuanReq.zoneId = "";
					} else {
						this.shaixuanReq.zoneId = item.id;
						this.shaixuan.zoneId = item;
					}
					this.zhuanquList.map((res) => {
						item.id == res.id ? (res.status = !res.status) : (res.status = true);
					});
				} else if (type == 7) {
					// 判断售价方式
					if (this.shaixuan.premiumType != "" && this.shaixuan.premiumType.id == item.id) {
						this.shaixuan.premiumType = "";
						this.shaixuanReq.premiumType = "";
					} else {
						this.shaixuanReq.premiumType = item.id;
						this.shaixuan.premiumType = item;
					}
					this.priceTypeList.map((res) => {
						item.id == res.id ? (res.status = !res.status) : (res.status = true);
					});
				} else if (type == 8) {
					// 判断审核状态
					for (var i = 0; i < this.shaixuan.stateType.length; i++) {
						if (this.shaixuan.stateType[i].id == item.id) {
							iss = true;
							sxIndex = i;
						}
					}
					if (!iss) {
						console.info(item)
						this.shaixuan.stateType.push({
							id: item.id,
							name: item.name,
							status: false,
						});
						this.shaixuanReq.stateType.push(item.id);
					} else {
						this.shaixuan.stateType.splice(sxIndex, 1);
						this.shaixuanReq.stateType.splice(sxIndex, 1);
					}
					this.stateTypeList.map((res) => {
						if (res.id == item.id) {
							res.status = !status;
						}
					});
				}
				that.$nextTick(function() {
					that.getAddFilterHeight();
				});
				that.souSuoTiJiao();
			},
			//清楚价格
			delPriceItem() {
				this.shaixuan.minPrice = "";
				this.shaixuanReq.minPrice = "";
				this.shaixuan.maxPrice = "";
				this.shaixuanReq.maxPrice = "";
				this.souSuoTiJiao();
			},
			//清除折扣筛选
			delDiscountItem() {
				this.shaixuan.minDiscount = "";
				this.shaixuanReq.minDiscount = "";
				this.shaixuan.maxDiscount = "";
				this.shaixuanReq.maxDiscount = "";
				this.souSuoTiJiao();
			},
			//最小价格输入
			bandPriceInputMin(e) {
				this.shaixuan.minPrice = e.detail.value;
				this.shaixuanReq.minPrice = e.detail.value;
				this.souSuoTiJiao();
			},
			//最大价格输入
			bandPriceInputMax(e) {
				this.shaixuan.maxPrice = e.detail.value;
				this.shaixuanReq.maxPrice = e.detail.value;
				this.souSuoTiJiao();
			},
			//最小折扣输入
			DiscountInputMin(e) {
				if (e.detail.value.indexOf(".") < 0 && e.detail.value != "") {
					if (e.detail.value > 10) {
						e.detail.value = 10;
					}
				} else if (e.detail.value.indexOf(".") == 0) {
					console.log('首位小数点情况')
					e.detail.value = e.detail.value.replace(/[^$#$]/g, "0.");
					e.detail.value = e.detail.value.replace(/\.{2,}/g, ".");
				} else if (!(/^(\d?)+(\.\d{0,3})?$/.test(e.detail.value))) {
					//去掉最后一位
					e.detail.value = e.detail.value.substring(0, e.detail.value.length - 1)
				}
				this.$nextTick(function() {
					this.shaixuan.minDiscount = e.detail.value;
					this.shaixuanReq.minDiscount = e.detail.value
					this.souSuoTiJiao();
				})
			},
			//最大折扣输入
			DiscountInputMax(e) {
				if (e.detail.value.indexOf(".") < 0 && e.detail.value != "") {
					if (e.detail.value > 10) {
						e.detail.value = 10;
					}
				} else if (e.detail.value.indexOf(".") == 0) {
					console.log('首位小数点情况')
					e.detail.value = e.detail.value.replace(/[^$#$]/g, "0.");
					e.detail.value = e.detail.value.replace(/\.{2,}/g, ".");
				} else if (!(/^(\d?)+(\.\d{0,3})?$/.test(e.detail.value))) {
					//去掉最后一位
					e.detail.value = e.detail.value.substring(0, e.detail.value.length - 1)
				}
				this.$nextTick(function() {
					this.shaixuan.maxDiscount = e.detail.value;
					this.shaixuanReq.maxDiscount = e.detail.value
					this.souSuoTiJiao();
				})
			},
			//搜索提交
			souSuoTiJiao() {
				this.$nextTick(function() {
					this.getAddFilterHeight();
				});
				var that = this;
				var reqData = {
					page: 1,
					limit: 20,
				};
				if (this.shaixuanReq.stockArea.length != 0) {
					reqData.stockArea = this.shaixuanReq.stockArea.join(",");
				}
				if (this.shaixuanReq.brandIds.length != 0) {
					reqData.brandIds = this.shaixuanReq.brandIds.join(",");
				}
				if (this.shaixuanReq.cids.length != 0) {
					reqData.cateIds = this.shaixuanReq.cids.join(",");
				}
				if (this.shaixuanReq.supplierIds.length != 0) {
					reqData.supplierIds = this.shaixuanReq.supplierIds.join(",");
				}
				// if (this.shaixuanReq.attrs.length != 0) {
				// 	reqData.attrs = this.shaixuanReq.attrs.join(",");
				// }
				if (this.shaixuanReq.minPrice && this.shaixuanReq.minPrice != 0) {
					if (getApp().globalData.waiwangIPdiqu == 1) {
						reqData.minPrice = this.shaixuanReq.minPrice * 0.85;
					} else if (getApp().globalData.waiwangIPdiqu == 2) {
						reqData.minPrice = this.shaixuanReq.minPrice * 7.5;
					} else {
						reqData.minPrice = this.shaixuanReq.minPrice;
					}
				}
				if (this.shaixuanReq.maxPrice && this.shaixuanReq.maxPrice != 0) {
					if (getApp().globalData.waiwangIPdiqu == 1) {
						reqData.maxPrice = this.shaixuanReq.maxPrice * 0.85;
					} else if (getApp().globalData.waiwangIPdiqu == 2) {
						reqData.maxPrice = this.shaixuanReq.maxPrice * 7.5;
					} else {
						reqData.maxPrice = this.shaixuanReq.maxPrice;
					}
				}
				if (this.shaixuanReq.minDiscount && this.shaixuanReq.minDiscount != 0) {
					reqData.minDiscount = this.shaixuanReq.minDiscount;
				}
				if (this.shaixuanReq.maxDiscount && this.shaixuanReq.maxDiscount != 0) {
					reqData.maxDiscount = this.shaixuanReq.maxDiscount;
				}
				if (this.keyWords != "") {
					reqData.keyword = this.keyWords;
				}
				if (this.shaixuanReq.seasonCode != "") {
					reqData.seasonCode = this.shaixuanReq.seasonCode
				}
				if (this.shaixuanReq.zoneId != "") {
					reqData.zoneId = this.shaixuanReq.zoneId
				}
				this.tableFrom = reqData

				//   if (that.tusouUrl && that.tusouUrl != "") {
				//     reqData.searchFlag = "true";
				//     uni.uploadFile({
				//       filePath: that.tusouUrl,
				//       name: "targetImage",
				//       url: HTTP_REQUEST_URL + "api/front/products/tusou",
				//       header: {
				//         "Content-Type": "multipart/form-data",
				//         accept: "application/json",
				//         mer_id: getApp().globalData.merId,
				//       },
				//       formData: reqData,
				//       success(resOK) {
				//         let res = JSON.parse(resOK.data);
				//         that.allNum = res.data.total;
				//         // 把从网络请求中的数据赋值给getaApp中的
				//         getApp().globalData.ShowNumList = res.data.list;
				//       },
				//       complete: function () {
				//         that.isClickOk = true;
				//       },
				//     });
				//   } else {
				//     getProductslist(reqData)
				//       .then((res) => {
				//         that.isClickOk = true;
				//         that.allNum = res.data.total;
				//         // 把从网络请求中的数据赋值给getaApp中的
				//         getApp().globalData.ShowNumList = res.data.list;
				//       })
				//       .catch((err) => {
				//         that.isClickOk = true;
				//       });
				//   }
			},
			// 重置
			cancelBtn() {
				var that = this;
				that.cancel();
				that.$emit("quxiao");
			},
			cancel() {
				this.allNum = "";
				// 遍历地区数组
				if (!this.isDiqu) {
					this.stockAreaList.map((item) => {
						item.status = true;
					});
					setTimeout(function() {
						this.stockAreaList = this.stockAreaList;
					}, 50);
					this.shaixuan.stockArea = [];
					this.shaixuanReq.stockArea = [];
				}
				if (!this.isPinPai) {
					this.brandList.map((item) => {
						if (item.item && item.item.length != 0) {
							item.item.map((itemC) => {
								itemC.status = false;
							});
						}
					});
					setTimeout(function() {
						this.brandList = this.brandList;
					}, 50);
					this.shaixuan.brandIds = '';
					this.shaixuanReq.brandIds = '';
				}
				console.info(this.zhuanquList)
				this.zhuanquList.map((item) => {
					item.status = true;
				});
				this.shaixuan.zoneId = "";
				this.shaixuanReq.zoneId = ''

				//遍历分类的数组
				this.productList.map((res) => {
					if (res.child && res.child.length != 0) {
						res.child.map((itemB) => {
							if (itemB.child && itemB.child.length != 0) {
								itemB.child.map((itemC) => {
									setTimeout(function() {
										itemC.status = true;
									}, 50);
								});
							}
						});
					}
				});

				this.shaixuan.minPrice = "";
				this.shaixuanReq.minPrice = "";
				this.shaixuan.maxPrice = "";
				this.shaixuanReq.maxPrice = "";

				this.shaixuan.minDiscount = "";
				this.shaixuanReq.minDiscount = "";
				this.shaixuan.maxDiscount = "";
				this.shaixuanReq.maxDiscount = "";
				this.shaixuan.seasonCode = "";
				this.shaixuanReq.seasonCode = ''



				this.shaixuan.cids = [];
				this.shaixuanReq.cids = [];

				this.addFilterHeight = 42;
				this.tusouUrl = "";
			},
			//查看
			seeLook() {
				this.$emit("getProductList", this.shaixuan, this.shaixuanReq);
			},
			clickTap(index) {
				this.classCS = false;
				this.navActive = 1111;
				this.brandShow = false; //品牌
				this.areaShow = false; //地区
				this.supplierShow = false; //供应商
				this.seasonShow = false; //季节
				this.zhuanquShow = false; //专区
				this.priceTypeShow = false; //售价方式
				this.stateTypeShow = false; // 审核状态
				//   this.sizeShow = false; //尺码
				this.priceShow = false; //价格
				this.DiscountShow = false; //折扣
				if (index == 0) {
					this.areaShow = true; //地区
				} else if (index == 1) {
					this.brandShow = true; //品牌
				} else if (index == 2) {
					this.supplierShow = true;
					// this.sizeShow = true; //尺码
				} else if (index == 3) {
					this.priceShow = true; //价格
				} else if (index == 4) {
					this.DiscountShow = true; //折扣
				} else if (index == 5) {
					this.seasonShow = true; //季节
				} else if (index == 6) {
					this.zhuanquShow = true; //专区
				} else if (index == 7) {
					this.priceTypeShow = true; //售价方式
				} else if (index == 8) {
					this.stateTypeShow = true; //审核状态
				}
				this.addNum = index;
			},
			// 新增函数==========start
			getBrand() {
				this.brandList = [];
				let tempArr = [];
				let _this = this
				getBrandList({
					type: 1
				}).then((res) => {
					if (res.code == 200) {
						_this.getZhuanQuList();

						this.tabItem.map((i, v) => {
							let obj = {
								title: i,
								item: [],
							};
							let flag = false;
							res.data.map((j, k) => {
								if (i == j.letter) {
									obj.item.push(j);
									tempArr.push(obj);
								}
							});
						});
						this.brandList = Array.from(new Set(tempArr));
						this.brandList.map((res) => {
							if (res.item && res.item.length != 0) {
								res.item.map((itemC) => {
									itemC.status = false;
								});
							}
						});
						if (
							this.shaixuanReq.brandIds &&
							this.shaixuanReq.brandIds.length != 0
						) {
							this.shaixuanReq.brandIds.forEach((data) => {
								this.brandList.map((res) => {
									if (res.item && res.item.length != 0) {
										res.item.map((itemC) => {
											if (itemC.code == data) {
												itemC.status = true;
											}
										});
									}
								});
							});
						}
					}
				});
			},
			touchStart(e) {
				this.touchmove = true;
				const query = uni.createSelectorQuery().in(this);
				query
					.select("#pinpaiTabItem0")
					.boundingClientRect((data) => {
						this.winOffsetY = data.top;
						this.itemHeight = data.height;
						let pageY = e.touches[0].pageY;
						let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight);
						let item = this.brandList[index];
						if (item) {
							this.scrollViewId = "uni-indexed-list-" + index;
							this.touchmoveIndex = index;
						}
					})
					.exec();
			},
			touchMove(e) {
				let pageY = e.touches[0].pageY;
				let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight);
				if (this.touchmoveIndex === index) {
					return false;
				}
				let item = this.brandList[index];
				if (item) {
					this.scrollViewId = "uni-indexed-list-" + index;
					this.touchmoveIndex = index;
				}
			},
			touchEnd() {
				this.touchmove = false;
				this.touchmoveIndex = -1;
			},
			// 新增函数==========end
			infoScroll: function() {
				let that = this;
				let len = that.productList.length;
				let child =
					that.productList[len - 1] && that.productList[len - 1].child ?
					that.productList[len - 1].child : [];
				this.number = child ? child.length : 0;
				//设置商品列表高度
				uni.getSystemInfo({
					success: function(res) {
						that.height = res.windowHeight * (750 / res.windowWidth);
					},
				});
				let height = 0;
				let hightArr = [];
				for (let i = 0; i < len; i++) {
					//获取元素所在位置
					let query = uni.createSelectorQuery().in(this);
					let idView = "#b" + i;
					query.select(idView).boundingClientRect();
					query.exec(function(res) {
						// let top = res[0].top;
						let top = res.top;
						hightArr.push(top);
						that.hightArr = hightArr;
					});
				}
			},
			tap: function(index, id) {
				// 点击分类的时候，显示其内容
				this.classCS = true;
				this.brandShow = false;
				this.areaShow = false;
				this.sizeShow = false;
				this.priceShow = false;
				this.DiscountShow = false;
				// 破坏样式可以改变的条件
				this.addNum = 1111;
				this.toView = id;
				this.navActive = index;
			},
			getAllCategory: function() {
				let that = this;
				categoryApi({
					status: 1,
					type: 1
				}).then((res) => {
					that.productList = res.data;
					that.processingDate();
					if (that.shaixuanReq.cids && that.shaixuanReq.cids.length != 0) {
						that.shaixuanReq.cids.forEach((data) => {
							that.productList.map((res1) => {
								if (res1.child && res1.child.length != 0) {
									res1.child.map((itemB) => {
										if (itemB.child && itemB.child.length != 0) {
											itemB.child.map((itemC) => {
												if (itemC.cids == data) {
													itemC.status = false;
												}
											});
										}
									});
								}
							});
						});
					}
					// that.infoScroll();
				});
			},
			processingDate: function() {
				let that = this;
				let data = that.productList;
				let arr1 = [];
				let childrenArr = [];
				data.map((res1) => {
					if (res1.id == 1757 || res1.id == 1758 || res1.id == 1759) {
						childrenArr.push(JSON.parse(JSON.stringify(res1))); //把儿童分类添加到数组childrenArr
					} else {
						arr1.push(res1); //普通分类添加arr1
					}
					if (res1.child && res1.child.length != 0) {
						let arr2 = [];
						res1.child.map((itemB) => {
							if (itemB.id != null && itemB.child && itemB.child.length != 0) {
								//把id为null或者没有三级的二级删除
								arr2.push(itemB);
								let all = JSON.parse(JSON.stringify(itemB));
								all.child = null;
								all.name = "全部" + all.name; //在三级分类前加全部，相当于二级分类
								itemB.child.unshift(all);
							}
						});
						res1.child = arr2;
					}
				});
				//儿童数据处理
				let childData = {
					"id": 99999,
					"cids": "99999",
					"pid": 0,
					"path": "/0/",
					"name": "儿童",
					"enName": "Children",
					"itName": "Bambino",
					"type": 1,
					"url": null,
					"extra": null,
					"status": true,
					"sort": 0,
					"child": [{
							"id": 99998,
							"cids": "99998",
							"pid": 0,
							"path": "/0/1499",
							"name": "服饰",
							"enName": "Apparel",
							"itName": "Abbigliamento",
							"type": 1,
							"url": null,
							"extra": null,
							"status": true,
							"sort": 0,
							"isAdvice": null,
							"ratio": null,
							"child": [],
						},
						{
							"id": 99997,
							"cids": "99997",
							"pid": 0,
							"path": "/0/1499/",
							"name": "鞋履",
							"enName": "Shoes",
							"itName": "scarpe",
							"type": 1,
							"url": null,
							"extra": null,
							"status": true,
							"sort": 0,
							"child": [],
						},
						{
							"id": 99996,
							"cids": "99996",
							"pid": 0,
							"path": "/0/1499/",
							"name": "配饰",
							"enName": "Accessories",
							"itName": "Accessori",
							"type": 1,
							"url": null,
							"extra": null,
							"status": true,
							"sort": 0,
							"child": [],
						},
					]
				};
				//console.log(childrenArr,"arr2JSON")
				childrenArr.map((res1) => {
					if (res1.child && res1.child.length != 0) {
						res1.child.map((itemB) => {
							let child = childData.child;
							if (itemB.child && itemB.child.length != 0) {
								if (itemB.id == "1760") {
									itemB.name = "婴儿服饰";
									itemB.enName = "baby clothes";
									itemB.itName = "abbigliamento da bimbi";
									child[0].child.push(itemB)
								}
								if (itemB.id == "1766") {
									itemB.name = "男童服饰";
									itemB.enName = "boys clothing";
									itemB.itName = "abbigliamento per ragazzi";
									child[0].child.push(itemB)
								}
								if (itemB.id == "1763") {
									itemB.name = "女童服饰";
									itemB.enName = "girls clothing";
									itemB.itName = "abbigliamento per ragazze";
									child[0].child.push(itemB)
								}
								if (itemB.id == "1761") {
									itemB.name = "婴儿鞋履";
									itemB.enName = "baby shoes";
									itemB.itName = "Scarpe per neonato";
									child[1].child.push(itemB)
								}
								if (itemB.id == "1767") {
									itemB.name = "男童鞋履";
									itemB.enName = "boys shoes";
									itemB.itName = "scarpe da ragazzo";
									child[1].child.push(itemB)
								}
								if (itemB.id == "1764") {
									itemB.name = "女童鞋履";
									itemB.enName = "girls shoes";
									itemB.itName = "scarpe da ragazza";
									child[1].child.push(itemB)
								}
								if (itemB.id == "1762") {
									itemB.name = "婴儿配饰";
									itemB.enName = "baby accessories";
									itemB.itName = "accessori per bambini";
									child[2].child.push(itemB)
								}
								if (itemB.id == "1768") {
									itemB.name = "男童配饰";
									itemB.enName = "boy accessories";
									itemB.itName = "accessori ragazzo";
									child[2].child.push(itemB)
								}
								if (itemB.id == "1765") {
									itemB.name = "女童配饰";
									itemB.enName = "girls accessories";
									itemB.itName = "accessori per ragazze";
									child[2].child.push(itemB)
								}
							}
						});
					}
				});
				//过滤空二级
				childData.child = childData.child.filter((res) => {
					return res.child.length != 0;
				});
				arr1.push(childData);
				that.productList = arr1;
			},
			scroll: function(e) {
				let scrollTop = e.detail.scrollTop;
				let scrollArr = this.hightArr;
				for (let i = 0; i < scrollArr.length; i++) {
					if (scrollTop >= 0 && scrollTop < scrollArr[1] - scrollArr[0]) {
						this.navActive = 0;
					} else if (
						scrollTop >= scrollArr[i] - scrollArr[0] &&
						scrollTop < scrollArr[i + 1] - scrollArr[0]
					) {
						this.navActive = i;
					} else if (
						scrollTop >=
						scrollArr[scrollArr.length - 1] - scrollArr[0]
					) {
						this.navActive = scrollArr.length - 1;
					}
				}
			},
			searchSubmitValue: function(e) {
				if (this.$util.trim(e.detail.value).length > 0)
					uni.navigateTo({
						url: "/pages/goods_list/index?searchValue=" + e.detail.value,
					});
				else
					return this.$util.Tips({
						title: this.$t("goods.pleaseFillInTheProductInformationToBeSearched"), //请填写要搜索的产品信息
					});
			},
			//季节列表
			getseasonList() {
				let _this = this;
				seasonListMer().then((res) => {
					let data = res.data;
					let objData = {
						id: -1,
						name: '-/-',
						status: true
					}
					data.unshift(objData)
					data.map((i) => {
						i.name = i.name;
						i.status = true;
						i.id = i.id;
					});
					_this.seasonList = data;
					_this.getSupplier();
				});
			},
			// 供应商
			getSupplier() {
				let _this = this;
				getVisibleSupplier().then((res) => {
					let data = res.data;
					data.map((i) => {
						i.name = i.suppliersName;
						i.status = true;
						i.id = i.id;
					});
					_this.supplierList = data;
				});
			},
			// 专区
			getZhuanQuList() {
				let _this = this;
				let data = {
					page: 1,
					limit: 9999,
				}
				if (_this.activeIndex == 1) {
					data.zoneType = 1
				}
				zoneList(data).then((res) => {
					let data = res.data.list;
					data.map((i) => {
						i.name = i.name;
						i.status = true;
						i.id = i.id;
					});
					_this.zhuanquList = data;
					_this.getseasonList();
				});
			},
			// 发货地
			getStockArea() {
				var _this = this;
				getStockArea().then((res) => {
					let data = res.data;
					data.map((i) => {
						i.name = i.stockAreaName;
						i.status = true;
						i.id = i.stockAreaCode;
					});
					_this.stockAreaList = data;
					_this.getBrand();
				});
			},
		},
	};
</script>
<style scoped lang="scss">
	// 修改页面新增================start
	.switch_tab {
		height: 90rpx;
		// margin-top: 101rpx;
		position: fixed;
		left: 0;
		right: 0;
		top: 96rpx;
		z-index: 99;
		background-color: #ffffff;
		border-bottom: 1px solid rgba(230, 230, 230, 1);

		.tab_item {
			flex: 1;
			font-size: 28rpx;
			font-weight: 300;

			.line {
				width: 52rpx;
				height: 6rpx;
				bottom: 0;
				background-color: rgba(34, 34, 34, 1);
			}
		}

		.active {
			font-size: 32rpx;
			font-weight: 500;
			color: rgba(44, 48, 56, 1);
		}
	}

	.brand_box {
		width: 76%;
		position: absolute;
		top: 0rpx;
		left: 24%;
		right: 0;
		bottom: 0;
		background-color: #ffffff;
		transition: all 0.2s ease-in-out;
		overflow: hidden;

		.item_title {
			font-size: 34rpx;
			padding: 26rpx 0;
			border-bottom: 1px solid rgba(225, 225, 225, 1);
		}

		.item_brand {
			padding: 20rpx 0;
			font-size: 30rpx;
		}
	}

	.size_box {
		overflow: auto;

		.areaBox {
			width: 33.3%;
			display: inline-block;
		}
	}

	.price_box {
		.price_content {
			height: 70rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;

			.priceInput {
				padding: 10rpx 20rpx;
				border: 2rpx solid #333;
				border-radius: 10rpx;
				text-align: center;
				margin: 20rpx;
			}

			.priceLink {
				width: 40rpx;
				height: 2rpx;
				background: #333;
				margin: 0 20rpx;
			}
		}
	}

	// 修改页面新增================end
	.productSort {
		width: 100%;
		height: 100vh;
		background-color: #f7f7f7;
	}

	.productSort .header {
		width: 100%;
		height: 96rpx;
		background-color: #fff;
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		z-index: 9;
		border-top: 1rpx solid #f5f5f5;
	}

	.productSort .header .input {
		width: 700rpx;
		height: 60rpx;
		background-color: #f5f5f5;
		// border-radius: 50rpx;
		box-sizing: border-box;
		padding: 0 25rpx;
	}

	.productSort .header .input .iconfont {
		font-size: 35rpx;
		color: #555;
	}

	.productSort .header .input .placeholder {
		color: #999;
	}

	.productSort .header .input input {
		font-size: 26rpx;
		height: 100%;
		width: 597rpx;
	}

	.productSort .aside {
		// position:absolute;
		width: 24%;
		left: 0;
		top: 0;
		background-color: #f7f7f7;
		overflow-y: auto;
		overflow-x: hidden;
		transition: all 0.2s ease-in-out;
		// margin-top: rpx;
	}

	.productSort .aside .item {
		height: 100rpx;
		width: 100%;
		font-size: 26rpx;
		color: #424242;
		position: relative;
	}

	// 点击选中时的样式改变
	.productSort .aside .item.on {
		background-color: #fff;
		width: 100%;
		text-align: center;
		color: rgba(175, 138, 64, 1);
		font-weight: bold;
	}

	.productSort .aside .item.on::after {
		content: "";
		display: block;
		width: 4rpx;
		height: 100rpx;
		background-color: rgba(175, 138, 64, 1);
		position: absolute;
		top: 0;
		left: 0;
	}

	.productSort .conter {
		position: absolute;
		top: 0;
		left: 24%;
		padding: 0 14rpx;
		background-color: #fff;
		right: 0;
	}

	.productSort .conter .listw {
		padding-top: 20rpx;
	}

	.productSort .conter .listw:last-child {
		padding-bottom: 90rpx;
	}

	.productSort .conter .listw .title {
		height: 88rpx;
		box-sizing: border-box;
		font-size: 32rpx;
		font-weight: bold;
		color: #222222;
		line-height: 88rpx;
		border-bottom: 2rpx solid #e6e6e6;
	}

	.productSort .conter .list {
		flex-wrap: wrap;
	}

	.productSort .conter .list .item {
		width: 150rpx;
		text-align: center;
		margin-top: 26rpx;
		margin-left: 10rpx;
		display: flex;
		justify-content: center;
		flex-wrap: wrap;
	}

	.productSort .conter .list .item .picture {
		width: 120rpx;
		height: 120rpx;
		border-radius: 50%;
	}

	.productSort .conter .list .item .picture image {
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}

	.productSort .conter .list .item .name {
		font-size: 28rpx;
		color: #222;
		height: 56rpx;
		line-height: 56rpx;
		width: 90%;
	}

	.changeColor {
		color: #af8a40;
		font-weight: 500;
		font-size: 28rpx;
		height: 56rpx;
		line-height: 56rpx;
		width: 90%;
	}

	.addFilter {
		width: 100%;
		max-width: 750rpx;
		background-color: #f6f6f6;
		font-size: 28rpx;
		transition: all 0.2s ease-in-out;
	}

	.addFilter .iconfont {
		margin-left: 36rpx;
		font-size: 20rpx;
	}

	.addFilter view {
		display: inline-block;
		padding: 10rpx 15rpx;
		background-color: #e6e6e6;
		margin: 10rpx 10rpx 15rpx 10rpx;
	}

	.bottomNav {
		width: 100%;
		height: 42px;
		display: flex;
		line-height: 42px;
	}

	.beforCurrent {
		position: relative;
		width: 50%;
		text-align: center;
		font-weight: 400;
		background-color: #f2f3f4;
		font-size: 32rpx;
	}

	.afterCurrent {
		position: relative;
		width: 50%;
		background-color: #000000;
		color: white;
		text-align: center;
		font-weight: 400;
		font-size: 32rpx;
	}

	.addText {
		position: absolute;
		top: 22rpx;
		left: 25rpx;
	}

	.changeW {
		padding: 25rpx;
		color: #222222;
		font-weight: 400;
	}

	.changeW2 {
		padding: 25rpx;
		color: #af8a40;
		font-weight: 400;
	}

	.warpCon {
		width: 100%;
		position: relative;
		transition: all 0.2s ease-in-out;
	}

	.uni-indexed-list {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	.uni-indexed-list__scroll {
		flex: 1;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.uni-indexed-list__menu {
		width: 24px;
		display: flex;
		flex-direction: column;
	}

	.uni-indexed-list__menu-item {
		display: flex;
		flex: 1;
		align-items: center;
		justify-content: center;
		/* #ifdef H5 */
		cursor: pointer;
		/* #endif */
	}

	.uni-indexed-list__menu-text {
		display: block;
		width: 40rpx;
		line-height: 40rpx;
		font-size: 24rpx;
		text-align: center;
		color: #333;
	}

	.uni-indexed-list__menu--active {
		background-color: rgb(255, 255, 255);
	}

	.uni-indexed-list__menu-text--active {
		background-color: #af8a40;
		border-radius: 50%;
	}

	.uni-indexed-list__alert-wrapper {
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.uni-indexed-list__alert {
		width: 80px;
		height: 80px;
		border-radius: 80px;
		text-align: center;
		line-height: 80px;
		font-size: 35px;
		color: #fff;
		background-color: rgba(0, 0, 0, 0.5);
	}
</style>
